<?xml version="1.0"?> 
<xsl:stylesheet 
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
  version="1.0"> 
  <xsl:output method="html"/> 
 
  <xsl:template match="/r/parameter"> 
	
	<table width="400px">
		<input type="hidden" name="id" id="id" value="{@id}" />
		<tr>
	        <td width="35%">Name:</td>
	        <td width="65%"><input id="name" name="name" value="{@name}"/></td>
	    </tr>
	    <tr>
	        <td>Type:</td>
	        <td>
	        	<div id="divType" />
			</td>
	    </tr>
	    <tr>
	        <td>isOrdered:</td>
	        <td>
	        	<xsl:if test="@isOrdered = 'True'">
	        		<input type="checkbox" id="isOrdered" name="isOrdered" value="1" checked="true" />isOrdered
	        	</xsl:if>
	        	<xsl:if test="@isOrdered != 'True'">
	        		<input type="checkbox" id="isOrdered" name="isOrdered" value="1" />isOrdered
	        	</xsl:if>
			</td>
	    </tr>
	    <tr>
	        <td>isUnique:</td>
	        <td>
	        	<xsl:if test="@isUnique = 'True'">
	        		<input type="checkbox" id="isUnique" name="isUnique" value="1" checked="true" />isUnique
	        	</xsl:if>
	        	<xsl:if test="@isUnique != 'True'">
	        		<input type="checkbox" id="isUnique" name="isUnique" value="1" />isUnique
	        	</xsl:if>
			</td>
	    </tr>
	    <tr>
	        <td>lower:</td>
	        <td>
        		<input id="lower" name="lower" value="{@lower}" />
			</td>
	    </tr>
	    <tr>
	        <td>upper:</td>
	        <td>
        		<input id="upper" name="upper" value="{@upper}" />
			</td>
	    </tr>
	    <tr>
	        <td>operation:</td>
	        <td>
	        	<xsl:value-of select="./operation/@name" />
			</td>
	    </tr>
		<tr>
	        <td>ownedComment:</td>
	        <td>
	        	<xsl:for-each select="./ownedComment">
	        		<xsl:value-of select="@id" />:
	        		<p><xsl:value-of select="@body" /></p>
    			</xsl:for-each>
			</td>
	    </tr>	    
		<tr>
	        <td>tag</td>
	        <td>
	        	<xsl:for-each select="./tag">
	        		<p><xsl:value-of select="@name" />: <xsl:value-of select="@value" /></p>
    			</xsl:for-each>
			</td>
	    </tr>	    
	    <tr>
	        <td>Insert new elements:</td>
	        <td>
	        	<a href="javascript:createComment('{@id}')">Comment</a><br />
	        	<a href="javascript:createTag('{@id}')">Tag</a><br />
			</td>
	    </tr>
	    <tr>
	        <td colspan="2" align="center"><button onclick="javascript:saveParameter('{@id}')">Save</button></td>
	    </tr>
	    <input type="hidden" id="class" name="class" value="{./class/@id}" />
	    <input type="hidden" id="typeId" name="typeId" value="{./type/@id}" />
	</table>
	</xsl:template>  
</xsl:stylesheet> 
